using System;
using System.Collections.Generic;
using System.Text;

namespace CMSWeb.Utility.Difference
{
	/// <summary>Data on one input file being compared.  
	/// </summary>
	public class DiffData<T> where T : IEquatable<T>
	{

		/// <summary>Number of elements (lines).</summary>
		protected int _length;

		public int Length
		{
			get { return _length; }
		}

		/// <summary>Buffer of numbers that will be compared.</summary>
		protected T[] _data;

		public T[] Data
		{
			get { return _data; }
		}

		/// <summary>
		/// Array of booleans that flag for modified data.
		/// This is the result of the diff.
		/// This means deletedA in the first Data or inserted in the second Data.
		/// </summary>
		protected bool[] _modified;

		public bool[] Modified
		{
			get { return _modified; }
		}

		/// <summary>
		/// Initialize the Diff-Data buffer.
		/// </summary>
		/// <param name="data">reference to the buffer</param>
		internal DiffData(T[] initData)
		{
			_data = initData;
			_length = initData.Length;
			_modified = new bool[_length + 2];
		}
	} 
}
